<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />





  <link rel="alternate" href="/atom.xml" title="耿瑞阳的博客" type="application/atom+xml" />






<meta name="description" content="下载mysql仍然使用中国科学技术大学镜像站下载mysql。最新版本的mysql。这里下载的mysql是二进制包，没有使用linux的包管理工具。">
<meta property="og:type" content="article">
<meta property="og:title" content="虚拟机安装Centos，安装mysql，配置主从（二）">
<meta property="og:url" content="https://Gengry.github.io/2018/02/06/虚拟机安装Centos，安装mysql，配置主从（二）/index.html">
<meta property="og:site_name" content="耿瑞阳的博客">
<meta property="og:description" content="下载mysql仍然使用中国科学技术大学镜像站下载mysql。最新版本的mysql。这里下载的mysql是二进制包，没有使用linux的包管理工具。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/19.jpg">
<meta property="og:image" content="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/20.jpg">
<meta property="og:image" content="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/21.jpg">
<meta property="og:image" content="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/22.jpg">
<meta property="og:image" content="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/23.jpg">
<meta property="og:image" content="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/24.jpg">
<meta property="og:image" content="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/25.jpg">
<meta property="og:updated_time" content="2018-02-22T05:50:45.162Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="虚拟机安装Centos，安装mysql，配置主从（二）">
<meta name="twitter:description" content="下载mysql仍然使用中国科学技术大学镜像站下载mysql。最新版本的mysql。这里下载的mysql是二进制包，没有使用linux的包管理工具。">
<meta name="twitter:image" content="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/19.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://Gengry.github.io/2018/02/06/虚拟机安装Centos，安装mysql，配置主从（二）/"/>





  <title>虚拟机安装Centos，安装mysql，配置主从（二） | 耿瑞阳的博客</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">耿瑞阳的博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://Gengry.github.io/2018/02/06/虚拟机安装Centos，安装mysql，配置主从（二）/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Geng">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="耿瑞阳的博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">虚拟机安装Centos，安装mysql，配置主从（二）</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-02-06T12:59:41+08:00">
                2018-02-06
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/linux/" itemprop="url" rel="index">
                    <span itemprop="name">linux</span>
                  </a>
                </span>

                
                
                  ， 
                
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/linux/mysql/" itemprop="url" rel="index">
                    <span itemprop="name">mysql</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="下载mysql"><a href="#下载mysql" class="headerlink" title="下载mysql"></a>下载mysql</h1><p>仍然使用<a href="http://mirrors.ustc.edu.cn/" target="_blank" rel="noopener">中国科学技术大学</a>镜像站下载mysql。<br>最新版本的<a href="http://iso.mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-5.7/mysql-5.7.20-linux-glibc2.12-i686.tar" target="_blank" rel="noopener">mysql</a>。<br>这里下载的mysql是二进制包，没有使用linux的包管理工具。<br><a id="more"></a></p>
<h1 id="阅读mysql安装文档"><a href="#阅读mysql安装文档" class="headerlink" title="阅读mysql安装文档"></a>阅读mysql安装文档</h1><p>通过百度打开mysql的官网，找到mysql5.7GA的文档。<br><img src="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/19.jpg" alt=""><br><img src="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/20.jpg" alt="">  </p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">shell&gt;</span><span class="bash"> groupadd mysql</span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> useradd -r -g mysql -s /bin/<span class="literal">false</span> mysql</span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> <span class="built_in">cd</span> /usr/<span class="built_in">local</span></span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> tar zxvf /path/to/mysql-VERSION-OS.tar.gz</span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> ln -s full-path-to-mysql-VERSION-OS mysql</span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> <span class="built_in">cd</span> mysql</span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> mkdir mysql-files</span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> chown mysql:mysql mysql-files</span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> chmod 750 mysql-files</span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> bin/mysqld --initialize --user=mysql </span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> bin/mysql_ssl_rsa_setup              </span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> bin/mysqld_safe --user=mysql &amp;</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> Next <span class="built_in">command</span> is optional</span></span><br><span class="line"><span class="meta">shell&gt;</span><span class="bash"> cp support-files/mysql.server /etc/init.d/mysql.server</span></span><br></pre></td></tr></table></figure>
<h1 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h1><p>使用xshell工具通过ssh连接到centos，ssh协议支持xftp协议，可以将本地的文件上传到虚拟机中的centos中。<br><img src="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/21.jpg" alt=""><br><img src="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/22.jpg" alt="">  </p>
<h2 id="创建用户及相关"><a href="#创建用户及相关" class="headerlink" title="创建用户及相关"></a>创建用户及相关</h2><p><img src="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/23.jpg" alt=""><br>将mysql目录及其子目录的所有者设置为mysql</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">mv mysql-5.7.21-linux-glibc2.12-x86_64 mysql</span><br><span class="line">cd /usr/local</span><br><span class="line">ln -s /home/mysql/mysql mysql</span><br><span class="line">cd /home/mysql</span><br><span class="line">mkdir mysql-data</span><br><span class="line">mkdir mysql-logs</span><br><span class="line">mkdir mysql-tmp</span><br><span class="line">chown mysql:mysql -R mysql/</span><br><span class="line"><span class="meta">#</span><span class="bash"> 初始化mysql的data文件夹</span></span><br><span class="line">[root@localhost mysql]# ./bin/mysqld  --initialize --user=mysql --basedir=/home/mysql/mysql --datadir=/home/mysql/mysql-data</span><br></pre></td></tr></table></figure>
<p><img src="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/24.jpg" alt="">  </p>
<h2 id="mysql配置文件"><a href="#mysql配置文件" class="headerlink" title="mysql配置文件"></a>mysql配置文件</h2><p>将下面的配置复制到 /etc/my.cnf中<br><figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">[client]</span></span><br><span class="line"><span class="attr">default_character_set</span> = utf8</span><br><span class="line"><span class="attr">port</span> = <span class="number">3306</span></span><br><span class="line"><span class="comment">#这个路径需要和mysqld中socket的路径相同</span></span><br><span class="line"><span class="attr">socket</span> = /tmp/mysql.sock</span><br><span class="line"></span><br><span class="line"><span class="section">[mysqld]</span></span><br><span class="line"><span class="attr">basedir</span> = /home/mysql/mysql</span><br><span class="line"><span class="attr">datadir</span> = /home/mysql/mysql-data</span><br><span class="line"><span class="attr">user</span> = mysql</span><br><span class="line"><span class="attr">port</span> = <span class="number">3306</span></span><br><span class="line"><span class="attr">server_id</span> = <span class="number">1</span></span><br><span class="line"><span class="attr">character_set_server</span> = utf8</span><br><span class="line"><span class="attr">socket</span> = /tmp/mysql.sock</span><br><span class="line"><span class="attr">pid-file</span> = /tmp/mysql.pid</span><br><span class="line"><span class="attr">log-bin</span> = /home/mysql/mysql-logs/bin_log  # 二进制日志，用户主从复制</span><br><span class="line"><span class="attr">relay-log</span> = /home/mysql/mysql-logs/relay_log  #从mysql的IO thread将主的bin_log复制到这个文件</span><br><span class="line"><span class="attr">log-error</span> = /home/mysql/mysql-logs/mysql_error.log</span><br><span class="line"><span class="attr">explicit_defaults_for_timestamp</span> = <span class="literal">true</span></span><br><span class="line"><span class="attr">expire_logs_days</span> = <span class="number">10</span></span><br><span class="line"><span class="attr">max_binlog_size</span> = <span class="number">100</span>M</span><br><span class="line"><span class="attr">binlog-do-db</span> =    #复制数据库名称</span><br><span class="line"><span class="attr">binlog-ignore-db</span> = mysql #忽略二进制日志的数据库名</span><br></pre></td></tr></table></figure></p>
<h2 id="配置启动脚本"><a href="#配置启动脚本" class="headerlink" title="配置启动脚本"></a>配置启动脚本</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">shell&gt;</span><span class="bash"> cp support-files/mysql.server /etc/init.d/mysql.server</span></span><br></pre></td></tr></table></figure>
<h2 id="启动mysql"><a href="#启动mysql" class="headerlink" title="启动mysql"></a>启动mysql</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">service mysql start</span><br></pre></td></tr></table></figure>
<p>报错<br><code>MySQL.2018-02-06T06:07:04.427707Z mysqld_safe error: log-error set to &#39;/home/mysql/mysql-logs/mysql_error.log&#39;, however file don&#39;t exists. Create writable for user &#39;mysql&#39;</code></p>
<p>需要手动建立error_log文件<br><figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">touch /home/mysql/mysql-logs/mysql_error.log</span><br><span class="line">service mysql start</span><br></pre></td></tr></table></figure></p>
<p>mysql已正常启动，可以使用mysql/bin目录下的mysql和之前记录的默认密码登录mysql<br>为root账户设置密码<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">alter</span> <span class="keyword">user</span> <span class="string">'root'</span>@<span class="string">'localhost'</span> <span class="keyword">identified</span> <span class="keyword">by</span> <span class="string">'root'</span>;</span><br></pre></td></tr></table></figure></p>
<p>把mysql注册成开机启动的服务<br><figure class="highlight dockerfile"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">chkconfig --<span class="keyword">add</span><span class="bash"> mysql</span></span><br></pre></td></tr></table></figure></p>
<h2 id="加入环境变量"><a href="#加入环境变量" class="headerlink" title="加入环境变量"></a>加入环境变量</h2><p>修改/etc/profile文件使其永久性生效，并对所有系统用户生效，在文件末尾加上如下两行代码<br>PATH=$PATH:/home/mysql/mysql:/home/mysql/mysql/bin<br>export PATH<br>最后：执行 命令source /etc/profile或 执行点命令 ./profile使其修改生效，执行完可通过echo $PATH命令查看是否添加成功。</p>
<h2 id="配置账户"><a href="#配置账户" class="headerlink" title="配置账户"></a>配置账户</h2><p>登录mysql配置一个可以远程访问的账户<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">GRANT</span> ALL <span class="keyword">PRIVILEGES</span> <span class="keyword">ON</span> *.* <span class="keyword">TO</span> <span class="string">'myuser'</span>@<span class="string">'%'</span><span class="keyword">IDENTIFIED</span> <span class="keyword">BY</span> <span class="string">'myuser'</span> <span class="keyword">WITH</span> <span class="keyword">GRANT</span> <span class="keyword">OPTION</span>;</span><br><span class="line"><span class="keyword">FLUSH</span> <span class="keyword">PRIVILEGES</span></span><br></pre></td></tr></table></figure></p>
<p>暂时关闭防火墙，否则外面访问不了<br>systemctl stop firewalld.service</p>
<h1 id="使用Navicat连接mysql"><a href="#使用Navicat连接mysql" class="headerlink" title="使用Navicat连接mysql"></a>使用Navicat连接mysql</h1><p>使用账户myuser 密码 myuser登录，<br>第一次登录没有成功，在本地用myuser登录一下mysql就可以用navicat连接上了。<br><img src="https://raw.githubusercontent.com/Gengry/blogImage/master/20180205/25.jpg" alt="">  </p>
<blockquote class="blockquote-center">今天最好的表现，是明天最低的要求。</blockquote>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/02/05/虚拟机安装Centos，安装mysql，配置主从（一）/" rel="next" title="虚拟机安装Centos，安装mysql，配置主从（一）">
                <i class="fa fa-chevron-left"></i> 虚拟机安装Centos，安装mysql，配置主从（一）
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/02/07/sourcetree免登陆授权/" rel="prev" title="sourcetree免登陆授权">
                sourcetree免登陆授权 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Geng</p>
              <p class="site-description motion-element" itemprop="description">今天最好的表现，是明天最低的要求。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">25</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">13</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">10</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#下载mysql"><span class="nav-number">1.</span> <span class="nav-text">下载mysql</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#阅读mysql安装文档"><span class="nav-number">2.</span> <span class="nav-text">阅读mysql安装文档</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#安装"><span class="nav-number">3.</span> <span class="nav-text">安装</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#创建用户及相关"><span class="nav-number">3.1.</span> <span class="nav-text">创建用户及相关</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#mysql配置文件"><span class="nav-number">3.2.</span> <span class="nav-text">mysql配置文件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#配置启动脚本"><span class="nav-number">3.3.</span> <span class="nav-text">配置启动脚本</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#启动mysql"><span class="nav-number">3.4.</span> <span class="nav-text">启动mysql</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#加入环境变量"><span class="nav-number">3.5.</span> <span class="nav-text">加入环境变量</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#配置账户"><span class="nav-number">3.6.</span> <span class="nav-text">配置账户</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#使用Navicat连接mysql"><span class="nav-number">4.</span> <span class="nav-text">使用Navicat连接mysql</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Geng</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
